﻿<Window x:Class="TeacherLoad.Windows.TeacherList"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:TeacherLoad.Windows"
        mc:Ignorable="d"
        Title="Преподаватели"
        Height="500" Width="900"
        MinHeight="500" MinWidth="900"
        WindowStartupLocation="CenterScreen"
        Background="#BFF7E9">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="320"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="25"/>
        </Grid.RowDefinitions>

        <GroupBox x:Name="HeaderTeacherAdd"
                  Header="Новый преподаватель"
                  BorderBrush="#200772">
            <StackPanel>
                <Label Content="Фамилия, имя и отчество"/>
                <TextBox x:Name="txFullName"
                         TextChanged="txFullName_TextChanged"
                         Height="70"
                         TextWrapping="Wrap"
                         VerticalScrollBarVisibility="Auto"/>
                
                <CheckBox x:Name="TeacherIsDismissed"
                          Margin="5, 10" Content="Преподаватель уволен"
                          Visibility="Collapsed"
                          Checked="TeacherIsDismissed_Checked"
                          Unchecked="TeacherIsDismissed_Unchecked"/>
                <Label x:Name="labelDate"
                        Content="Дата увольнения"
                        Visibility="Collapsed"/>
                <DatePicker x:Name="DateDismissed"
                            Margin="5"
                            FontSize="14"
                            Visibility="Collapsed"/>
                <Button x:Name="btnAddTeacher"
                         Content="Добавить преподавателя"
                         Click="btnAddTeacher_Click"/>
                <Button x:Name="btnCancelEdit"
                         Content="Отменить редактирование"
                         Visibility="Collapsed"
                         Click="btnCancelEdit_Click"/>
                <Button x:Name="btnClearText"
                         Content="Очистить поля ввода"
                         Visibility="Collapsed"
                         Click="btnClearText_Click"/>
            </StackPanel>
        </GroupBox>

        <GroupBox Grid.Column="1"
                  Header="Список преподавателей">
            <Grid x:Name="DataListTeacher">
                <Grid.RowDefinitions>
                    <RowDefinition Height="50"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="50"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Label Content="Поиск"
                           VerticalAlignment="Center"/>
                    <ComboBox x:Name="cbListTeacher"
                              Grid.Column="1"
                              ItemsSource="{Binding}" Margin="5, 12" IsEditable="True"
                              SelectionChanged="cbListTeacher_SelectionChanged"/>
                </Grid>
                <ListBox x:Name="listTeacher"
                         ItemsSource="{Binding}"
                         SelectionChanged="listTeacher_SelectionChanged"
                         Grid.Row="1">
                    <ListBox.ContextMenu>
                        <ContextMenu>
                            <MenuItem x:Name="ChangeRow"
                                      Header="Изменить данные"
                                      Click="ChangeRow_Click"/>
                            <MenuItem x:Name="DoubleRow"
                                      Header="Создать дупликат"
                                      Click="DoubleRow_Click"/>
                        </ContextMenu>
                    </ListBox.ContextMenu>
                </ListBox>
            </Grid>
        </GroupBox>
        <StatusBar Grid.Row="1" Grid.ColumnSpan="2"
                   Background="#BFF7E9">
            <StatusBarItem>
                <TextBlock Text="{Binding StringFormat=Количество строк: {0},
                    ElementName=listTeacher, Path=Items.Count}"
                    Margin="5 0"/>
            </StatusBarItem>
        </StatusBar>

    </Grid>
</Window>
